<?php
$tr = Zend_Registry::get('Zend_Translate');
?>

<style type="text/css">
#fieldset-usedtime dl dt, #fieldset-usedtime dl dd 
{
  display: inline;
}
#fieldset-usedtime dl dd 
{
  padding-right: 1em;
}
</style>

<div id="submenu">
  <ul>
    <li class="back"><a href="<?php echo $this->url(array('controller' => 'ticket', 'action' => 'index'), '', true); ?>"><?php echo $tr->_("Back");?></a></li> 
  </ul>
</div>

<img src="/images/icons/tickets.png" alt="" /><h2><?php echo sprintf($tr->_("Ticket #%s: %s"), $this->id, $this->escape($this->subject));?></h2>
<?php echo sprintf($tr->_("Considers company: %s"), $this->company);?><br />
<?php echo sprintf($tr->_("Priority: %s"), $this->priority);?><br />
<?php echo sprintf($tr->_("Added: %s"), $this->date);?><br />
<?php echo sprintf($tr->_("Reported by %s | %s | %s"), $this->personname, $this->email, $this->phone);?><br />
<br />

<?php echo $tr->_("People worked with this ticket:");?><br />
<?php
$p = $this->people;
echo "<ul>";
for($i=0; $i<count($p); $i++)
{
  echo "<li>{$p[$i]['writer']} ({$p[$i]['writeremail']})</li>";
}
echo "</ul>";
?>

<br />

<img src="/images/icons/chat.png" alt="" /><h2><?php echo $tr->_("History");?></h2>
<?php
$r = $this->replies;
echo "<table>\n";

$odd = true;
for($i=0; $i<count($r); $i++)
{
  $class = $odd ? 'rowOdd' : 'rowEven';

  echo "<tr class=\"$class\">\n";
  echo "  <td valign=\"top\">{$r[$i]['added']}<br />{$r[$i]['writer']} {$r[$i]['writerphone']}<br />{$r[$i]['writeremail']}</td>\n";
  echo "  <td width=\"100%\" valign=\"top\">{$r[$i]['descr']}</td>\n";
  echo "</tr>\n";
  
  $odd = !$odd;
}

echo "</table>\n";
?>

<br />

<img src="/images/icons/add.png" alt="" /><a name="replyform" id="replyform"></a>
<h2><?php echo $tr->_("Reply to this ticket");?></h2>
<?php if(!empty($this->message)):?>
<span class="error">
<img src="<?php echo $this->baseUrl();?>/images/icons/error.png" alt="" border="0" />
<?php echo $this->message;?>
</span><br />
<?php
endif;

echo $this->form;
?>

<br />

<img src="/images/icons/branch-office.png" alt="" /><h2><?php echo $tr->_("Add reference to existing ticket");?></h2>
<iframe src="/ticket/add-reference/id/<?php echo $this->id;?>" width="100%" height="100" name="ticket-reference" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0"></iframe>
<iframe src="/ticket/search/layout/disabled" width="100%" height="300" name="ticket-search" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0"></iframe>
